#ifndef _C_THREAD_H_
#define _C_THREAD_H_


//------------------------------------------------------------------------------
// Thread status
//------------------------------------------------------------------------------
#define THREAD_STATUS_NOTSTARTED    0
#define THREAD_STATUS_STARTED       1
#define THREAD_STATUS_STOPPED       2
#define THREAD_STATUS_SUSPENDED     3

#include <windows.h>
#include <process.h>

class C_Thread 
{
public:
	C_Thread(unsigned int iProperties);
	virtual ~C_Thread();

 
  void Create();
  void Stop();

   
  bool IsRunning();

 

 protected:  
 
  virtual void InitWork() = 0;  
  virtual void DoWork() = 0;  
  virtual void StopWork() = 0;  
  virtual void CleanWork() = 0;
  HANDLE hThread;

 private:
 
  static void* StartRoutine(void* pThread);
  unsigned int m_iFlags;

  int m_iStatus;
  WORD dwId;
 

};

#endif